package com.hzf.booklibrary.api.device;

import com.hzf.booklibrary.base.Constant;
import com.hzf.booklibrary.bean.device.Deviceinfo;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class DeviceApi {

    public static DeviceApi instance;

    private DeviceApiService service;

    public DeviceApi() {
        //联网请求
        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl(Constant.BASE_DEVICE_URL)
                // 添加Gson转换器
                .addConverterFactory(GsonConverterFactory.create())

                .build();

        service = retrofit.create(DeviceApiService.class);

    }

    public static DeviceApi getInstance() {
        if (instance == null)
            instance = new DeviceApi();
        return instance;
    }

    public Call<Deviceinfo> getDeviceInfo(String token,String orgId){
        return service.getDeviceInf(token,orgId);
    }

}
